<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景图缩放</title>
    <style>
        /* 盒子大小 500*600px */
        .box1{
            width: 500px;
            height: 600px;
            background-image: url(./img/img01.jpg);
            background-repeat: no-repeat;
            background-size: cover;
            background-color: pink;
            color: gray;
        }
        .box2{
            width: 500px;
            height: 600px;
            background-image: url(./img/img01.jpg);
            background-repeat: no-repeat;
            background-size: contain;
            background-color: pink;
            color: gray;
        }
        .box3{
            width: 500px;
            height: 600px;
            background-image: url(./img/img01.jpg);
            background-repeat: no-repeat;
            background-size: 100% 100%;
            background-color: pink;
            color: gray;
        }
        .box4{
            width: 500px;
            height: 600px;
            background-image: url(./img/img01.jpg);
            background-repeat: no-repeat;
            background-size: 500px 600px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div class="box1"> cover缩放 </div>
    <br>
    <div class="box2"> contain缩放 </div>
    <br>
    <div class="box3"> 100% 100%百分比缩放 </div>
    <br>
    <div class="box4"> 500px 600px数值缩放 </div>


</body>
</html>